<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    const handler = {
      get: function (obj, prop) {
        console.log(" getter - ", prop)
        return prop in obj ? obj[prop] : 37;
      },
      set: function (obj, prop, value) {
        console.log(" setter")
        obj[prop] = value;
        // 表示成功
        return true;
      }
    }

    // const proxy1 = new Proxy({ a: { b: 1 } }, handler);
    // proxy1.a.b = 2;
    // // proxy1.b = 1;

    // console.log(proxy1.a.b)
    var pormiseVar;
    try {
      pormiseVar = new Promise((resolve, reject) => {

        try {
          throw "errr";
          setTimeout(() => {
            // resolve();
            // reject();
          }, 2000);
        } catch (error) {
          console.log(" try  catch -- ")
        }
      })
    } catch (error) {
      console.log(" try  catch -- ")
    }

    pormiseVar.then((result) => {
      console.log("ddd -- ")
    }).catch((err) => {
      console.log(" outter try catch -- ")
    });
  </script>
</body>

</html>